package com.test.singleton.ehan;

//饿汉模式, 静态变量
public class Singleton1 {

    //1.构造器私有化
    private Singleton1(){}
    //2.本部类创建实例对象
    private final static Singleton1 instance = new Singleton1();

    //3.暴露公共静态方法,返回实例对象
    public static Singleton1 getInstance(){
        return instance;
    }

}
